package logic

import (
	"context"
	"fmt"
	"github.com/xxl-job/xxl-job-executor-go"
	"github.com/zeromicro/go-zero/core/logx"
	"mrshen_xxljob_demo/internal/svc"
)

var svcContext *svc.ServiceContext

func NewDemo01logic(ctx context.Context, svcCtx *svc.ServiceContext) {
	svcContext = svcCtx
}

func Demo01(cxt context.Context, param *xxl.RunReq) (msg string) {
	logx.Debugf("svcContext: ", svcContext.Config.XxlJobConf)
	fmt.Println("Demo01 one task" + param.ExecutorHandler + " param：" + param.ExecutorParams + " log_id:" + xxl.Int64ToStr(param.LogID))
	addr := svcContext.Config.XxlJobConf.ServerAddr
	logx.Debugf("haa", addr)
	return "test done"
}
